package com.snk.common.pojo;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;


@Data
@NoArgsConstructor
/**
 * 借助此对象封装控制层响应到客户端的数据
 */
public class JsonResult implements Serializable {
    private static final long serialVersionUID = 2080943344863436345L;
private Integer state=1;
private String message="OK";
private Object data;
public JsonResult(String message){
    this.message=message;
}

    public JsonResult(Object data){

        this.data=data;
    }
    public JsonResult(Throwable e){
        this.state=0;
        this.message=e.getMessage();
    }

}
